<?php
/**
 * Copyright (c) 2006-2007, Julien PORTALIER
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright    Copyright (c) 2006-2007, Julien PORTALIER
 * @link         http://featherphp.googlecode.com/
 * @license      http://www.opensource.org/licenses/mit-license.php The MIT License
 */

/**
 * Base error handler.
 */
class Error
{
	/**
	 * Displays a specific error (404, 403, 500, etc.)
	 */
	static function show($status, $action=null, $data=null)
	{
		$params = array();
		$load   = Load::getInstance();
		$errors = $load->controller('error_handler', env('REQUEST_URI'), $action, $params);
		
		if (!empty($data))
			$errors->data =& $data;
		
		$errors->index($status, $action);
		exit;
	}
}
?>